package com.example.lol.ui.fragment;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.lol.R;
import com.example.lol.adapter.NewsArticleAdapter;
import com.example.lol.base.BaseFragment;
import com.example.lol.bean.NewsArticleBean;

public class ThreeFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private NewsArticleAdapter mAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_three;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.game_list);
    }

    @Override
    protected void initData() {
        mAdapter = new NewsArticleAdapter();

        NewsArticleBean t1 = new NewsArticleBean("小蜜蜂宝典现已上线可前往客户端参与活动",
                " LOL ","英雄联盟官方",R.drawable.home_page_middle_new_read,
                "956",R.drawable.icon1);
        mAdapter.addData(t1);
        NewsArticleBean t2 = new NewsArticleBean("福牛杯专题：企鹅电竞、虎牙、斗鱼晋级选手产生",
                " LOL ","掌小萌",R.drawable.home_page_middle_new_read,
                "1021",R.drawable.icon2);
        mAdapter.addData(t2);
        NewsArticleBean t3 = new NewsArticleBean("英雄联盟：妹妹中单凤凰对线卡牌我就是个卖酸梅的",
                " LOL ","琉璃月说游戏",R.drawable.home_page_middle_new_read,
                "1010",R.drawable.icon2);
        mAdapter.addData(t3);
        NewsArticleBean t4 = new NewsArticleBean("掌盟戏精王：新密码不能与原密码相同",
                " LOL ","掌盟戏精王",R.drawable.home_page_middle_new_read,
                "1021",R.drawable.icon1);
        mAdapter.addData(t4);
        NewsArticleBean t5 = new NewsArticleBean("小蜜蜂宝典现已上线可前往客户端参与活动",
                " LOL ","英雄联盟官方",R.drawable.home_page_middle_new_read,
                "956",R.drawable.icon1);
        mAdapter.addData(t5);
        NewsArticleBean t6 = new NewsArticleBean("福牛杯专题：企鹅电竞、虎牙、斗鱼晋级选手产生",
                " LOL ","掌小萌",R.drawable.home_page_middle_new_read,
                "1021",R.drawable.icon2);
        mAdapter.addData(t6);
        NewsArticleBean t7 = new NewsArticleBean("英雄联盟：妹妹中单凤凰对线卡牌我就是个卖酸梅的",
                " LOL ","琉璃月说游戏",R.drawable.home_page_middle_new_read,
                "1010",R.drawable.icon2);
        mAdapter.addData(t7);
        NewsArticleBean t8 = new NewsArticleBean("掌盟戏精王：新密码不能与原密码相同",
                " LOL ","掌盟戏精王",R.drawable.home_page_middle_new_read,
                "1021",R.drawable.icon1);
        mAdapter.addData(t8);

    }

    @Override
    protected void bindData() {
        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mAdapter);

    }

    @Override
    protected void bindEvent() {

    }
}
